package com.ck.client.core;

import com.ck.client.core.interceptor.CkClientPermissionInterceptor;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootConfiguration
public class WebConfig implements WebMvcConfigurer {
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(ckClientPermissionInterceptor()).addPathPatterns("/**");
	}

	@Bean
	public CkClientPermissionInterceptor ckClientPermissionInterceptor() {
		return new CkClientPermissionInterceptor();
	}

	
}
